﻿@model DataAccess.Models.AgencyRobot
@{
    ViewBag.Title = "Edit";
}


@section Scripts{

    <script src="~/Scripts/plugins/layer/layer.min.js"></script>

    <script src="~/Scripts/plugins/validate/jquery.validate.min.js"></script>
    <script src="~/Scripts/plugins/validate/messages_zh.min.js"></script>
    <script src="~/Scripts/sys/lib/common_raw.js"></script>

    <script src="~/js/bootstrap-timepicker.min.js"></script>
    <script>
        //  var index = parent.layer.getFrameIndex(window.name);

        $(function () {

            $("#submit").bind("click", Save);

        })

        function Save() {
            var flockname = $.trim($("input[name=flockname]").val());
            if (flockname.length == 0) {
                layer.tips('绑定文本信息不能为空！', 'input[name=flockname]', { tips: [2, '#78BA32'] });
                return false;
            }

            var au_name = $.trim($("input[name=au_name]").val());
            if (au_name.length == 0) {
                layer.tips('推广者账户不能为空！', 'input[name=au_name]', { tips: [2, '#78BA32'] });
                return false;
            }

            var imagetextsecond = $.trim($("input[name=imagetextsecond]").val());
            if (!imagetextsecond.match(/^(\d+)$/)) {
                layer.tips('时间格式不正确！', 'input[name=imagetextsecond]', { tips: [2, '#78BA32'] });
                return false;
            }

            var flocksendsecond = $.trim($("input[name=flocksendsecond]").val());
            if (!flocksendsecond.match(/^(\d+)$/)) {
                layer.tips('时间格式不正确！', 'input[name=flocksendsecond]', { tips: [2, '#78BA32'] });
                return false;
            }

            var flocktype = $("#flocktype").val();
            var flockadmin = $("#flockadmin").val();
            //  var state = $("#state").val();
            var id = $("#id").val();
            // var remark = $("#remark").val();

            var timepicker1 = $('#timepicker1').val();
            var timepicker2 = $('#timepicker2').val();
            var timepicker3 = $('#timepicker3').val();
            var timepicker4 = $('#timepicker4').val();
            var timepicker5 = $('#timepicker5').val();
            var timepicker6 = $('#timepicker6').val();



            common.invokeApi(
                "post",
                "/editAgencyRobot.html",
                //"id=" + id + "&state=" + state + "&username=" + username + "&password=" + password + "&nickname=" + nickname + "&tel=" + tel,
                { id: id, au_name: au_name, flocktype: flocktype, flockname: flockname, flockadmin: flockadmin, imagetextsecond: imagetextsecond, flocksendsecond: flocksendsecond, timepicker1: timepicker1, timepicker2: timepicker2, timepicker3: timepicker3, timepicker4: timepicker4, timepicker5: timepicker5, timepicker6: timepicker6 },
                function () { },
                function (data) {
                    common.msg(data.Message, 1, function () {
                        //parent.location.reload();
                        //parent.layer.close(index);
                        window.location.href = "/AgencyRobot.html";
                    });
                },
                function (data) {
                    common.msg(data.Message, 2, function () { });
                },
                function () { }
                );
        }


        //timepicker
        $('[id*=timepicker]').timepicker({
            minuteStep: 5,
            showSeconds: true,
            showMeridian: false,
            disableFocus: false,
            showWidget: true
        }).focus(function () {
            $(this).next().trigger('click');
        });
        //$('#timepicker2').timepicker({
        //    minuteStep: 5,
        //    showSeconds: true,
        //    showMeridian: false,
        //    disableFocus: false,
        //    showWidget: true
        //}).focus(function () {
        //    $(this).next().trigger('click');
        //});
    </script>


}


<div class="row" style="opacity: 1;">
    <div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <ol class="breadcrumb">
                    <li><a href="#">首页</a></li>
                    <li class="active"><span>代理管理</span></li>
                </ol>
                <h1>代理绑定管理</h1>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="main-box">
                    <header class="main-box-header clearfix">
                        <h2>代理绑定信息</h2>
                    </header>
                    <div class="main-box-body clearfix">
                        <form role="form" method="post">
                            <input type="hidden" id="id" name="id" value="@(Model.Id)" />

                            <div class="row">
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="flocktype">绑定类型</label>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                                <select id="flocktype" name="flocktype" class="form-control">
                                                    <option value="1">微信群</option>
                                                    

                                                </select>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="flockname">绑定文本信息</label>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar-o"></i></span>
                                                <input type="text" class="form-control" id="flockname" name="flockname" value="@Model.FlockName">
                                            </div>
                                            <span class="help-block">例：优惠券福利群1000</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="au_name">推广者账户</label>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                                <input type="text" class="form-control" id="au_name" name="au_name" value="@Model.AU_Name">
                                            </div>

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="flockadmin">管理员号</label>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar-o"></i></span>
                                                <input type="text" class="form-control" id="flockadmin" name="flockadmin" value="@Model.FlockAdmin">
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-lg-12">
                                    <div class="row">
                                        <div class="form-group col-md-6">
                                            <label for="imagetextsecond">图文间隔时间（m）</label>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                                <input type="text" class="form-control" id="imagetextsecond" name="imagetextsecond" value="@Model.ImageTextSecond">
                                            </div>

                                        </div>

                                        <div class="form-group col-md-6">
                                            <label for="flocksendsecond">单说单间隔时间(m)</label>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar-o"></i></span>
                                                <input type="text" class="form-control" id="flocksendsecond" name="flocksendsecond" value="@Model.FlockSendSecond">
                                            </div>
                                        </div>
                                    </div>
                                </div>



                                <div class="col-lg-12">
                                    <div class="row">
                                        <div class="form-group col-md-6">
                                            <label for="imagetextsecond">发单时间段</label>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <div class="input-group input-append bootstrap-timepicker">
                                                            <div class="bootstrap-timepicker-widget dropdown-menu open"><table><tbody><tr><td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td></tr><tr><td><input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"></td></tr><tr><td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td></tr></tbody></table></div>
                                                            <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
                                                            
                                                            <input type="text" class="form-control" id="timepicker1" name="timepicker1" value="@ViewBag.timepicker1">

                                                        </div>
                                                    </td>
                                                    <td>-</td>
                                                    <td>
                                                        <div class="input-group input-append bootstrap-timepicker">
                                                            <div class="bootstrap-timepicker-widget dropdown-menu open"><table><tbody><tr><td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td></tr><tr><td><input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"></td></tr><tr><td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td></tr></tbody></table></div>
                                                            <input type="text" class="form-control" id="timepicker2" name="timepicker2" value="@ViewBag.timepicker2">

                                                        </div>
                                                    </td>
                                                </tr>

                                                <tr>
                                                    <td>
                                                        <div class="input-group input-append bootstrap-timepicker">
                                                            <div class="bootstrap-timepicker-widget dropdown-menu open"><table><tbody><tr><td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td></tr><tr><td><input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"></td></tr><tr><td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td></tr></tbody></table></div>
                                                            <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>

                                                            <input type="text" class="form-control" id="timepicker3" value="@ViewBag.timepicker3">

                                                        </div>
                                                    </td>
                                                    <td>-</td>
                                                    <td>
                                                        <div class="input-group input-append bootstrap-timepicker">
                                                            <div class="bootstrap-timepicker-widget dropdown-menu open"><table><tbody><tr><td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td></tr><tr><td><input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"></td></tr><tr><td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td></tr></tbody></table></div>
                                                            <input type="text" class="form-control" id="timepicker4" value="@ViewBag.timepicker4">

                                                        </div>
                                                    </td>
                                                </tr>

                                                <tr>
                                                    <td>
                                                        <div class="input-group input-append bootstrap-timepicker">
                                                            <div class="bootstrap-timepicker-widget dropdown-menu open"><table><tbody><tr><td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td></tr><tr><td><input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"></td></tr><tr><td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td></tr></tbody></table></div>
                                                            <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>

                                                            <input type="text" class="form-control" id="timepicker5" value="@ViewBag.timepicker5">

                                                        </div>
                                                    </td>
                                                    <td>-</td>
                                                    <td>
                                                        <div class="input-group input-append bootstrap-timepicker">
                                                            <div class="bootstrap-timepicker-widget dropdown-menu open"><table><tbody><tr><td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td></tr><tr><td><input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"></td> <td class="separator">:</td><td><input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"></td></tr><tr><td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td></tr></tbody></table></div>
                                                            <input type="text" class="form-control" id="timepicker6" value="@ViewBag.timepicker6">

                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>

                                        </div>

                                         
                                    </div>
                                    
                                        </div>
                                 






                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button type="button" id="submit" class="btn btn-success">提交</button>
                                    </div>
                                </div>

                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<footer id="footer-bar" class="row" style="opacity: 1;">
    <p id="footer-copyright" class="col-xs-12">
        Powered by PRISM Theme.
    </p>
</footer>

